package ru.ganyaev.file_system;

import java.io.File;
import java.nio.file.Path;

public class BasicFileSystemManager extends FileSystemManager {
    @Override
    public Boolean isPathExists(Path path)
            throws BasicFileSystemManagerException {
        File file = path.toFile();
        return file.exists();
    }

    @Override
    public void createFolder(Path path) throws BasicFileSystemManagerException {
        File folder = path.toFile();
        if (!folder.exists() && !folder.mkdirs()) {
            throw new BasicFileSystemManagerException("Can not create '" + path
                    + "' folder");
        }
    }
}
